﻿@model IEnumerable<Kunlun.Models.Address>
@{
	ViewBag.Title = "用户地址列表";
}
@section Head
{
	<link href="@Url.Content("~/Content/member/style.css")" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		$(function () {
			$(".RemoveLink").click(function () {

				var recordToDelete = $(this).attr("data-id");

				if (recordToDelete != '') {
					$.post("/MyKunlun/RemoveAddress", { "id": recordToDelete },
                    function (data) {
                    	$('#row-' + recordToDelete).fadeOut('slow');

                    });
				}
			});

		});
	</script>
}
<div id="content">
	@Html.Partial("_MymenuPartial")
	<fieldset class="right">
		<p class="bu">
			<input type="button" class="buttonL" value="新增地址" onclick="location.href='@Url.Action("AddressAdd")'" />
		</p>
		<table>
			<tr>
				<th>
					省市区
				</th>
				<th>
					联系人
				</th>
				<th>
					详细地址
				</th>
				<th>
					固定电话
				</th>
				<th>
					移动手机
				</th>
				@*<th>
					电子邮件
				</th>*@
				<th>
					邮编
				</th>
				<th>
					配送时间
				</th>
				<th>
				</th>
			</tr>
			@foreach (var item in Model) {
				<tr id="row-@item.AddressID">
					<td>
						@item.Provice.proviceName - @item.City.cityName - @item.Area.areaName
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.LinkMan)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.AddressPlace)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.Phone)
					</td>
@*					<td>
						@Html.DisplayFor(modelItem => item.Mobile)
					</td>*@
					<td>
						@Html.DisplayFor(modelItem => item.Email)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.Post)
					</td>
					<td>
						@Html.DisplayFor(modelItem => item.DeliveTime)
					</td>
					<td>
						@Html.ActionLink("编辑", "AddressEdit", new { id = item.AddressID }) | <a href="#" class="RemoveLink" data-id='@item.AddressID'>
							删除</a>
					</td>
				</tr>
   }
		</table>
	</fieldset>
</div>
